import echarts from '@/echarts'

export let option = {
    //你的代码
    tooltip: {
        trigger: 'axis',
        axisPointer: {
            type: 'shadow'
        },
        textStyle: {
            color: '#fff',
            fontSize: 12
        },
        confine: true, // 超出范围
        backgroundColor: 'rgba(17,95,182,0.5)', //设置背景颜色
        //   borderColor: "rgba(255, 255, 255, .8)",
        formatter: '{b}<br>{a}：{c}万元<br>{a1}：{c1}万元<br>'
    },
    legend: {
        top: '4%',
        y: 'center',
        itemWidth: 20,
        itemHeight: 20,
        itemGap: 15,
        textStyle: {
            fontSize: 18,
            color: '#fff',
            padding: [0, 0, 0, 6]
        }
    },
    grid: {
        top: '18%',
        left: '4%',
        right: '4%',
        bottom: '2%',
        containLabel: true
    },
    xAxis: [
        {
            type: 'category',
            data: [],
            axisTick: {
                show: false,
                alignWithLabel: true
            },
            axisLine: {
                lineStyle: {
                    color: '#1C82C5'
                }
            },
            axisLabel: {
                interval: 0,
                margin: 10,
                color: '#05D5FF',
                textStyle: {
                    fontSize: 14,
                    color: '#fff'
                }
            }
        }
    ],
    yAxis: [
        {
            type: 'value',
            name: '收入（元）',
            splitNumber: 5,
            nameTextStyle: {
                color: '#fff',
                fontSize: 12,
                align: 'center',
                padding: [0, 0, 0, 0]
            },
            axisLabel: {
                formatter: '{value}',
                color: 'rgba(95, 187, 235, 1)',
                textStyle: {
                    fontSize: 14,
                    color: '#fff',
                    lineHeight: 16
                }
            },
            axisTick: {
                show: false
            },
            splitLine: {
                show: true,
                lineStyle: {
                    color: 'rgba(28, 130, 197, .3)',
                    type: 'dashed'
                }
            }
        },
        {
            name: '占比',
            splitNumber: 5,
            type: 'value',
            nameTextStyle: {
                color: '#fff',
                fontSize: 12,
                align: 'center',
                padding: [0, 0, 0, 0]
            },
            axisLabel: {
                show: true,
                fontSize: 12,
                color: '#fff'
            },
            axisLine: {
                show: false
            },
            axisTick: {
                show: false
            },
            splitLine: {
                show: false
            }
        },
        {
            // name: "销售增长率（%）",
            splitNumber: 5,
            // offset: 50,
            type: 'value',
            nameTextStyle: {
                color: '#fff',
                fontSize: 12,
                align: 'center',
                padding: [0, 0, 0, 0]
            },
            axisLabel: {
                show: false,
                fontSize: 12,
                color: '#fff'
            },
            axisLine: {
                show: false
            },
            axisTick: {
                show: false
            },
            splitLine: {
                show: false
            }
        }
    ],
    series: [
        {
            name: '贫困地区平均收入',
            type: 'bar',
            yAxisIndex: 2,
            barWidth: '16',
            barGap: '50%',
            data: [],
            label: {
                show: true
            },
            itemStyle: {
                borderRadius: [20, 20, 0, 0],
                color: {
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    colorStops: [
                        {
                            offset: 0,
                            color: 'rgba(16, 160, 242, 1)'
                        },
                        {
                            offset: 1,
                            color: 'rgba(0, 82, 184, 0)'
                        }
                    ]
                }
            }
        },
        {
            name: '全省农民平均收入',
            type: 'bar',
            yAxisIndex: 0,
            barWidth: '16',
            barGap: '50%',
            label: {
                show: true
            },
            data: [],
            itemStyle: {
                borderRadius: [20, 20, 0, 0],
                color: {
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    colorStops: [
                        {
                            offset: 0,
                            color: 'rgba(0, 216, 255, 1)'
                        },
                        {
                            offset: 1,
                            color: 'rgba(0, 216, 255, 0)'
                        }
                    ]
                }
            }
        },
        {
            name: '占比',
            yAxisIndex: 1,
            type: 'line',
            showSymbol: true,
            smooth: true,
            symbolSize: 8,
            lineStyle: {
                normal: {
                    color: '#02D3EA'
                }
            },
            areaStyle: {
                normal: {
                    //线性渐变，前4个参数分别是x0,y0,x2,y2(范围0~1);相当于图形包围盒中的百分比。如果最后一个参数是‘true’，则该四个值是绝对像素位置。
                    color: new echarts.graphic.LinearGradient(
                        0,
                        0,
                        0,
                        1,
                        [
                            {
                                offset: 0,
                                color: '#0090ff'
                            },
                            {
                                offset: 1,
                                color: 'rgba(0,0,0, 0)'
                            }
                        ],
                        false
                    ),
                    shadowColor: 'rgba(53,142,215, 0.9)', //阴影颜色
                    shadowBlur: 20 //shadowBlur设图形阴影的模糊大小。配合shadowColor,shadowOffsetX/Y, 设置图形的阴影效果。
                }
            },
            itemStyle: {
                color: '#02D3EA',
                borderColor: '#02D3EA',
                borderWidth: 2
            },
            label: {
                show: true,
                position: 'top',
                formatter: '{c}%',
                textStyle: {
                    fontSize: 14,
                    color: '#fff'
                }
            },
            data: [] // 折线图的数据
        }
    ]
} as any
